package net.lab1024.sa.admin.module.business.wms.warehouse.domain.form;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import lombok.Data;

/**
 * 仓库信息表 新建表单
 *
 * @Author ADog
 * @Date 2025-10-17 17:25:29
 * @Copyright 1.0
 */

@Data
public class WarehouseAddForm {

    @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "主键ID 不能为空")
    private Long warehouseId;

    @Schema(description = "仓库编码（唯一，如“XM-MJ001”表示厦门模具仓）", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "仓库编码（唯一，如“XM-MJ001”表示厦门模具仓） 不能为空")
    private String warehouseCode;

    @Schema(description = "仓库名称（如“厦门总仓-精密模具库”）", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "仓库名称（如“厦门总仓-精密模具库”） 不能为空")
    private String warehouseName;

    @Schema(description = "仓库类型：1-模具仓、2-零件仓、3-成品仓、4-原材料仓", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "仓库类型：1-模具仓、2-零件仓、3-成品仓、4-原材料仓 不能为空")
    private Integer warehouseType;

    @Schema(description = "仓库级别（1-总仓、2-分仓、3-子仓，用于层级区分）", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "仓库级别（1-总仓、2-分仓、3-子仓，用于层级区分） 不能为空")
    private Integer warehouseLevel;

    @Schema(description = "仓库详细地址（如“厦门市集美区杏林工业园3号厂房”）")
    private String warehouseLocation;

    @Schema(description = "仓库总面积（㎡）")
    private BigDecimal warehouseArea;

    @Schema(description = "仓库负责人（日常运营）")
    private String warehouseHead;

    @Schema(description = "安全责任人（专管安全检查）")
    private String safetyManager;

    @Schema(description = "安全等级：1-高（24h监控）、2-中、3-低")
    private Integer safetyLevel;

    @Schema(description = "最后一次安全检查时间")
    private LocalDateTime lastSafetyCheckTime;

    @Schema(description = "父仓库ID（0表示顶级仓库，用于层级关联）", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "父仓库ID（0表示顶级仓库，用于层级关联） 不能为空")
    private Long parentId;

    @Schema(description = "祖级ID列表（如“1,2”表示父级+祖父级，用于快速查询层级）")
    private String ancestors;

    @Schema(description = "仓库最大容量（m³）")
    private BigDecimal maxVolume;

    @Schema(description = "仓库最大承重（kg）")
    private BigDecimal maxWeight;

    @Schema(description = "环境特性")
    private String environmentFeatures;

    @Schema(description = "设备配置（如“叉车2台、行车1台、恒温系统1套”）")
    private String equipmentConfig;

    @Schema(description = "关联库存总数（非实时，定时同步，用于删除校验）", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "关联库存总数（非实时，定时同步，用于删除校验） 不能为空")
    private Integer stockCount;

    @Schema(description = "最后一次库存同步时间")
    private LocalDateTime lastStockSyncTime;

    @Schema(description = "叶子节点标志：0-非叶子（有子仓库）、1-叶子（无子仓库）", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "叶子节点标志：0-非叶子（有子仓库）、1-叶子（无子仓库） 不能为空")
    private Integer leafFlag;

    @Schema(description = "是否禁用：0-启用、1-禁用", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "是否禁用：0-启用、1-禁用 不能为空")
    private Integer isDisabled;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "创建时间 不能为空")
    private LocalDateTime createTime;

    @Schema(description = "更新时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "更新时间 不能为空")
    private LocalDateTime updateTime;

    @Schema(description = "备注（如“存放高精度模具，禁止无关人员进入”）")
    private String remark;

}